import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'dart:ui';


class NewsDetailPage extends StatefulWidget {
  final String id;

  NewsDetailPage({Key key, this.id}):super(key: key);

  @override
  NewsDetailPageState createState() => new NewsDetailPageState(id: this.id);
}

class NewsDetailPageState extends State<NewsDetailPage> {
  String id;
  final flutterWebview = new FlutterWebviewPlugin();
  
  NewsDetailPageState({Key key, this.id}){
    var url = "https://daily.zhihu.com/story/$id";
    print(window.devicePixelRatio);
    flutterWebview.launch(url,
                  rect: new Rect.fromLTWH(
                      0.0, 
                      0.0, 
                      window.physicalSize.width/window.devicePixelRatio, 
                      window.physicalSize.height/window.devicePixelRatio),
                  withZoom: false,
                  withLocalStorage: true,
                  withJavascript: true);
  }

  @override
  void initState() {
    super.initState();
    
  }

  @override
    void dispose() {
      super.dispose();
      flutterWebview.dispose();
    }


  @override
  Widget build(BuildContext context) {
      return new Container(

      );
    }
}